import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'index',
    component: () => import('../views/index.vue'),
    children: [
      {
        path: '/home',
        alias:'/',
        name: 'home',
        component: HomeView,
      },
      {
        path: '/my',
        name: 'my',
        component: () => import('../views/My.vue')
      },
      {
        path: '/publish',
        name: 'publish',
        component: () => import('../views/home/publish.vue')
      },
    ]
  },
  {
    path: '/my-list',
    name: 'my-list',
    component: () => import('../views/my-list.vue')
  },
  {
    path: '/reg',
    name: 'reg',
    component: () => import('../views/reg.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/loGin.vue')
  },
  {
    path: '/home-list',
    name: 'home-list',
    component: () => import('../views/home/home-list.vue')
  },
  {
    path: '/pasXl',
    name: 'pasXl',
    component: () => import('../views/my/pasXl.vue')
  },
  {
    path: '/getPass',
    name: 'getPass',
    component: () => import('../views/my/getPass.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
